import defaultSettings from '@/settings'
export const dialogMixin = {
  data() {
    return {
      // 数据字典
      dictMap: {},
      open: false,
      title: '编辑表单',
      // 表单参数
      editForm: {},
    };
  },
  mounted() {
  },
  methods: {
    // 初始化字典数据
    loadDicts(dictCodeList) {
      // 加载数据字典
      this.getDictsList(dictCodeList).then((res) => {
        if(res.result && Object.keys(res.result).length) {
          for (let dictCode of Object.keys(res.result)) {
            // 更新到数据字典对象中
            this.$set(this.dictMap,dictCode,res.result[dictCode])
          }
        }
      });
    },
    show() {
      this.open = true
    },
    // 取消按钮
    close(state = false) {
      this.open = false;
      // this.resetForm('editForm');
      if(typeof state === 'boolean') {
        this.$emit('editComplete',state);
      }
    },
  }
}
